package com.quanyan.place.mapper;

import com.quanyan.place.entity.*;
import com.quanyan.place.entity.apireq.ReqSurveyPlace;
import com.quanyan.place.entity.apiresp.RespPlaceInfo;
import com.quanyan.place.entity.apiresp.RespPlaceLocation;
import com.quanyan.place.entity.apiresp.RespSurveyPlace;
import com.quanyan.place.entity.apiresp.RespSurveyPlaceBaseInfo;
import com.quanyan.place.entity.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.xmlbeans.impl.tool.Extension;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface VPlaceMapper {

    List<VPlaceAndUnit> selectPlaceAndUnit(@Param("cityId") Integer cityId,
                                           @Param("districtId") Integer districtId,
                                           @Param("keyWords") String keyWords,
                                           @Param("begin") Integer begin,
                                           @Param("pageSize") Integer pageSize);

    Integer countPlaceAndUnit(@Param("cityId") Integer cityId,
                              @Param("districtId") Integer districtId,
                              @Param("keyWords") String keyWords);


    List<VPlaceTime> getPrimeTimeByPlaceId(@Param("placeId") Integer placeId,
                                                                @Param("unitId") Integer unitId);

    List<VPlaceTime> getBusinessTimeByPlaceId(@Param("placeId") Integer placeId);

    List<VClassifiedStatistic> countPlaceUnitByCategoryId(@Param("placeId") Integer placeId);

    List<VPlaceBusiness> selectPlaceGroupData(@Param("cityId")Integer cityId,
                                              @Param("category") Integer category,
                                              @Param("districtId") Integer districtId,
                                              @Param("primeType") Integer primeType,
                                              @Param("isSign") Integer isSign);

    List<VPlaceSale> selectPlaceSaleData(@Param("cityId")Integer cityId,
                                              @Param("category") Integer category,
                                              @Param("districtId") Integer districtId);


    List<TbBizPlaceUnitStatistics> getPlaceUnitStatistics(@Param("cityId")Integer cityId,
                                                @Param("districtId") Integer districtId,
                                                @Param("category") Integer category);

    List<TbBizPlaceUnitStatistics> getStatisticsByPlaceId(@Param("placeId")Integer placeId);

    List<TbBizPlace> getCommercePlaceList(@Param("uid") Integer uid,
                                          @Param("keyWords") String keyWords,
                                          @Param("begin") Integer begin,
                                          @Param("pageSize") Integer pageSize);

    Integer countCommercePlace(@Param("uid") Integer uid,
                              @Param("keyWords") String keyWords);

    void insertSalePlanBatch(@Param("salePlanList") List<TbBizPlaceUnitSalePlan> salePlanList);

    List<RespPlaceInfo> getCanSalePlaceList(@Param("begin") Integer begin,
                                          @Param("pageSize") Integer pageSize);

    Integer countPlace(@Param("keyWords") String keyWords,
                       @Param("cityId") Integer cityId,
                       @Param("districtId") Integer districtId,
                       @Param("isSign") Byte isSign,
                       @Param("categoryId") Byte categoryId,
                       @Param("businessMode") Byte businessMode,
                       @Param("isShelves") Byte isShelves,
                       @Param("buyType") Integer buyType);

    List<RespPlaceInfo> getPlaceList(@Param("begin") Integer begin,
                                         @Param("pageSize") Integer pageSize,
                                         @Param("keyWords") String keyWords,
                                         @Param("cityId") Integer cityId,
                                         @Param("districtId") Integer districtId,
                                         @Param("isSign") Byte isSign,
                                         @Param("categoryId") Byte categoryId,
                                         @Param("businessMode") Byte businessMode,
                                         @Param("isShelves") Byte isShelves,
                                         @Param("buyType") Integer buyType);

    List<RespPlaceInfo> getPlaceListByCategoryId(ReqPlaceSearch reqVo);

    int getPlaceListByCategoryIdCount(ReqPlaceSearch reqVo);

    void updateSalePlanToInvalidate(@Param("entityId")Integer entityId, @Param("type") Byte type, @Param("categoryId")Integer categoryId);

    void updateAllSalePlanToInvalidate(@Param("entityId")Integer entityId, @Param("type") Byte type);

    void updateSalePlanMainToInvalidate(@Param("placeId")Integer placeId, @Param("categoryId")Integer categoryId);

    int updateSalePlanByTempleateId(@Param("tbBizPlaceUnitSalePlanMain") TbBizPlaceUnitSalePlanMain tbBizPlaceUnitSalePlanMain);

    List<RespPlaceLocation> getPlaceLocation(@Param("placeIdstr")String placeIds);

    Integer countPlaceOrder(@Param("uid") Integer uid, @Param("isOnlyFromApp") Byte isOnlyFromApp);

    Integer countSalePlanMain(@Param("placeId")Integer placeId, @Param("categoryId")Integer categoryId);

    void updateSalePlanUnitName(@Param("placeUnitId")Integer placeUnitId, @Param("unitName") String unitName);

    void updateSalePlanMainUnitName(@Param("placeUnitId")Integer placeUnitId, @Param("unitName") String unitName);

    void delInvalidSalePlan(@Param("placeId")Integer placeId);

    int countAdminUserForSupplier(@Param("group_id")Integer group_id);

    List<TbAdminUser> selectAdminUserForSupplier(@Param("group_id")Integer group_id,
                                                 @Param("begin")Integer begin,
                                                 @Param("length")Integer length);

    void updatePlaceOrderBusinessMode(@Param("placeId")Integer placeId, @Param("businessMode")Byte businessMode);

    List<RespSurveyPlace> getSurveyPlaceListByCondition(ReqSurveyPlace reqSurveyPlace);

    List<RespSurveyPlaceBaseInfo> getSurveyPlaceBaseInfo(@Param("placeId")Integer placeId);

    List getShareVipPlaceList(@Param("placeId")Integer placeId, @Param("vipShareNo") String vipShareNo, @Param("isFilter") boolean isFilter);

    List<Integer> getShareVipPlaceIds(@Param("placeId")Integer placeId);

    List<Integer> getSharePlaceIdsByVipShareNo(@Param("vipShareNo")String vipShareNo);

    List<Integer> getCategoryIdsByPlaceId(@Param("placeId")Integer placeId);

    List<TbBizPlaceAttach> selectSupportMemberPlace();

    void deleteSalePlanByPlaceAndDate(@Param("placeId")Integer placeId, @Param("date")String date);
}